using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NAppUpdater
{
    public partial class Kontrola : Form
    {
        public Kontrola()
        {
            InitializeComponent();
            timer1.Start();
        }

        //private void Kontrola_Load(object sender, EventArgs e)
        //{
          
        //}

        private void timer1_Tick(object sender, EventArgs e)
        {
            Process[] processlist = Process.GetProcessesByName("NApp");
            if (processlist.Length == 0)
            {
                DialogResult = DialogResult.OK;
                this.Close();
            }
            listBox1.Items.Clear();
            
            foreach (Process theprocess in processlist)
            {
                listBox1.Items.Add(String.Format("Process: {0} ID: {1} \n", theprocess.ProcessName, theprocess.Id));
            }

        }
    }
}